import socket
import time

cilent = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
addr = (socket.gethostname(), 8778)
print("等待与服务器连接")
cilent.connect(addr)
print("等待服务器发送数据")
while True:
    data = cilent.recv(1024).decode()
    print(f'从服务器收到的数据->[{data}]')
    time.sleep(0.5)
    cilent.send('F'.encode())